﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TM.QWeibo.Dal
{
    public class Status:Base
    {
        readonly SDK.API.UpdateCount _api = new SDK.API.UpdateCount(OAuthInstance);

        /// <summary>
        /// 实例
        /// </summary>
        public static Status Instance {
            get {
                return new Status();
            }
        }

        /// <summary>
        /// 检查更新数据，不至0
        /// </summary>
        /// <param name="callback"></param>
        public void Check(Action<SDK.Objects.UpdateCount> callback)
        {
            _api.Check((rs) =>
            {
                callback(rs.Data);
            });
        }

        /// <summary>
        /// 检查更新数据，至0
        /// </summary>
        /// <param name="type">至0位</param>
        /// <param name="callback"></param>
        public void Check(SDK.Objects.UpdateCount.ECountType type, Action<SDK.Objects.UpdateCount> callback)
        {
            _api.Check(type, (rs) =>
            {
                callback(rs.Data);
            });
        }

        /// <summary>
        /// 指定位清0
        /// </summary>
        /// <param name="type"></param>
        public void Clear(SDK.Objects.UpdateCount.ECountType type)
        {
            _api.Clear(type);
        }
    }
}
